import java.util.Arrays;

/**
 * @Author: Liu, Yunfeng
 * @DateTime: 2021/7/20 21:07
 * @Description: TODO
 */
public class minPairSum {
    public static int minPairSum(int[] nums) {
        Arrays.sort(nums);
        int maxSum = 0;
        int length = nums.length;
        for (int i = 0; i < length / 2; i++) {
            maxSum = Math.max(maxSum, nums[i] + nums[length - i - 1]);
        }
        return maxSum;
    }

    public static void main(String[] args) {
        int[] nums = {3,5,4,2,4,6};
        System.out.println(minPairSum(nums));
    }
}
